<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div:nth-child(1) {
            width: 200px;
            height: 200px;
            background-color: aqua;
            transition: all 1.8s;
        }

        div:nth-child(2) img {
            width: 200px;
            height: 100px;
        }

        div:nth-child(2) {
            position: relative;
            width: 200px;
            height: 100px;
            margin: 0 auto;
        }

        div:nth-child(2) span {
            position: absolute;
            top: 0;
            left: -11px;
            display: block;
            width: 10px;
            height: 10px;
            line-height: 10px;
            border: 1px solid black;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div></div>
    <div>
        <img src="/pink/imgs/zyz_txt/1.png" alt="">
        <span class="span">X</span>
    </div>
    <script>
        var div = document.querySelectorAll('div')
        var b = document.querySelector('.span')
        div[0].onclick = () => {
            div[0].style.backgroundColor = 'black';
            div[0].style.width = '400px';
        }
        b.onclick = () => {
            div[1].style.display = 'none';
        }
    </script>
</body>

</html>